'''
no 1
'''
# for i in range(1, 5):
#     for j in range(1, 5):
#         for k in range(1, 5):
#             if i==j or j==k or i==k:
#                 continue
#             else:
#                 print(str(i) + str(j) + str(k))


'''
no 2 各种进制转换
'''
# i = 30
# i_2 = bin(i)
# i_8 = oct(i)
# i_16 = hex(i)
# print(i)
# print(i_2)
# print(i_8)
# print(i_16)
# print(int(i_16, 16))


'''
no 3    字符串，整数，小数之间的转换
'''
# stri = '0x10'
# floati = 1.3456768
# inti = 1
# print(int(stri,16))
# print(inti)
# print(floati)
# print(int(floati))
# print(float(inti))

'''
no 4        字符串常规操作
'''
stri = 'i love you python'
print(stri)                 # i love you python
print(stri[5])              # e
print(stri[0:5])            # i lov
print(stri[:5])             # i lov
print(stri[5:])             # e you python
print(stri.find('o'))       # 3
print(stri.index('o'))      # 3
print(stri.find('x'))       #-1
# print(stri.index('x'))    # get a error 'ValueError
print(stri[-4])             # t
print(stri[:-4])            # i love you py
print(stri[-4:])            # thon
print(stri[-8:-4])          # u py
print(stri[-4:-8] == '')    # True
print(len(stri[-4:-8]) == 0)    # True
print(stri.replace('o','p'))    # i lpve ypu pythpn



